package com.huanzhidadi.single.overloadandoverride;

public class OverloadClass {

    public void testOverload(String name) {
        System.out.println(name);
    }

    public void testOverload(String name, Integer age) {
        System.out.println(name + ", " + age);
    }

    /**
     * 入参顺序不同也构成重载
     * @param age
     * @param name
     */
    public void testOverload(Integer age, String name) {
        System.out.println("交换参数位置，" + name + ", " + age);
    }

    /**
     * 重载overload跟返回值类型无关
     * @param name
     * @param age
     * @return

    public String testOverload(String name, Integer age) {
        System.out.println(name + ", " + age);
        return "ok";
    }
     */
}
